$(function(){
	/**饼图**/
	var myChart = echarts.init(document.getElementById('main'));
	var option = {
	    series: [{
	        name:'电池健康状态',
	        type:'pie',
	        radius: ['50%', '70%'],
	        avoidLabelOverlap: false,
	        label: {
	            normal: {
	//          	formatter: function (obj) {
	//              	return obj.percent+'\n'+obj.data.name;
	//          	},
					formatter: '{d}%\n{b}',
	                show: false,
	                position: 'center',
	            },
	            emphasis: {
	                show: true,
	                textStyle: {
	                    fontSize: '30',
	                    fontWeight: 'bold',
	                    color: '#fff'
	                }
	            }
	        },
	        
	        data:[
	            {value:27, name:'优'},
	            {value:7, name:'良'},
	            {value:27, name:'中'},
	            {value:6, name:'差'},
	        ]
	    }],
	    color:['#3a7bff', '#9b5cff','#e04f92','#41fbf8']
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(option);
	
	
	setTimeout(function(){
		window.onresize = function(){
			myChart.resize();
		}
		
	})
	
	
	
});


